<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:a4j="http://richfaces.org/a4j" xmlns:a="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

	<rich:spacer height="30" />
	<a4j:form>
		<a4j:status>
			<f:facet name="start">
				<h:graphicImage value="/img/spinner.gif" />
			</f:facet>
		</a4j:status>
		<rich:panel>
			<f:facet name="header">
				<h:outputText value="Adding a new discipline" />
			</f:facet>
			<h:panelGrid columns="3" width="400">
				<h:outputText value="Name" />
				<h:outputText value="Description" />
				<h:outputText value="" />
				<h:inputText value="#{disciplinesManage.newDisciplineName}" />
				<h:inputText value="#{disciplinesManage.newDisciplineDesc}" />
				<a4j:commandButton value="Add" reRender="mainTable3"
					action="#{disciplinesManage.addDiscipline}" />
			</h:panelGrid>
		</rich:panel>
	</a4j:form>

	<a4j:form>
		<rich:spacer height="30" />
		<rich:panel>
			<f:facet name="header">
				<h:outputText value="Browsing existing disciplines" />
			</f:facet>
			<h:panelGrid columns="1" id="mainTable3">
				<rich:dataTable rowKeyVar="rkv" width="400" rows="10"
					value="#{disciplinesManage.all}" var="discipline"
					onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
					onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
					<rich:column id="nameDiscCol">
						<f:facet name="header">
							<h:outputText styleClass="headerText" value="Name" />
						</f:facet>
						<h:outputText value="#{discipline.name}" />
					</rich:column>
					<rich:column id="descDiscCol">
						<f:facet name="header">
							<h:outputText styleClass="headerText" value="Description" />
						</f:facet>
						<h:outputText value="#{discipline.description}" />
					</rich:column>

					<rich:column id="partDelCol">
						<f:facet name="header">
							<h:outputText styleClass="headerText" value="Delete" />
						</f:facet>
						<a4j:commandLink
							action="#{disciplinesManage.removeDiscipline(discipline)}"
							reRender="mainTable3" value="Delete" />
					</rich:column>
					<f:facet name="footer">
						<rich:datascroller align="center" />
					</f:facet>
				</rich:dataTable>
			</h:panelGrid>
		</rich:panel>
	</a4j:form>
</ui:composition>